#include<stdio.h>
struct Singer
{
	int number;
	int score[6];
	float average;
}singer[5];
void swap(struct Singer *a,struct Singer *b)
{
	struct Singer temp=*a;
	*a=*b;
	*b=temp;
}
int main()
{
	int i,j,k;
	for(i=0;i<5;i++)
	{
		singer[i].number=i+1;
		
	} 
	for(i=0;i<5;i++)
	{
		for(j=0;j<6;j++)
		{
			scanf("%d",&singer[i].score[j]);
		}
	}
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			for(k=0;k<5-j;k++)
			{
				if(singer[i].score[k]>singer[i].score[k+1])
				{
					int temp1=singer[i].score[k];
					singer[i].score[k]=singer[i].score[k+1];
					singer[i].score[k+1]=temp1;
				}
			}
		}
	}
	for(i=0;i<5;i++)
	{
		singer[i].average=((singer[i].score[1]+singer[i].score[2]+singer[i].score[3]+singer[i].score[4])/4.0);
	}
	for(i=0;i<4;i++)
	{
		for(j=0;j<4-i;j++)
		{
			if(singer[j].average<singer[j+1].average)
			{
				swap(&singer[j],&singer[j+1]);
			}
		}
	}
	for(i=0;i<5;i++)
	{
		printf("00%d %.2f\n",singer[i].number,singer[i].average);
	}
	return 0;
}
